import React from 'react';
import { Input, Col, message } from 'antd';
import SearchBar from 'src/components/SearchBar';
import List from './list';
import services from '../../../../../services/api/index';
import CommonListsIndex from '../../../../../components/CommonLists/index';
import FilterTool from '../../../../../components/FilterTool';

class ComponentVersionIndex extends CommonListsIndex {
  constructor(props) {
    super(props);
    this.listsComponent = List;
    this.model_width = 600;
    this.api = 'componentVersion';
  }
  componentDidMount() {
    this.freshQueryList();
  }

  getSearchList = () => {
    return [
      {
        name: 'name',
        component: <Input placeholder='名称' />,
      },
    ];
  };

  render() {
    const ListsComponent = this.listsComponent;
    return (
      <div>
        <SearchBar
          searchList={this.getSearchList()}
          query={this.freshQueryList}
          onChange={this.refreshFilter}
          reset={this.resetListAndSearch}
        />
        <div className='inner-content' style={{ marginTop: '10px' }}>
          {/* <Row type='flex' justify='space-between' align='middle' className='pb-10'>
            <Col span={6} style={{ textAlign: 'middle' }}>
              <Button type='primary' onClick={}>
                版本对比
              </Button>
            </Col>
          </Row> */}
          <ListsComponent
            {...this.state}
            edit={this.edit}
            queryList={this.freshQueryList}
            onChangePagination={this.onChangePagination}
          />
        </div>
      </div>
    );
  }
}

export default ComponentVersionIndex;
